package cn.anecansaitin.whimsy.client.item.render;

import cn.anecansaitin.whimsy.Whimsy;
import cn.anecansaitin.whimsy.test.item.TestArm;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.PlayerSkin;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.DefaultedItemGeoModel;
import software.bernie.geckolib.model.GeoModel;
import software.bernie.geckolib.renderer.GeoItemRenderer;

public class TestArmRender extends GeoItemRenderer<TestArm> {
    private final GeoModel<TestArm> wide = new DefaultedItemGeoModel<>(Whimsy.resource("test_arm_wide"));
    private final boolean isWide;

    public TestArmRender() {
        super(new DefaultedItemGeoModel<>(Whimsy.resource("test_arm_slim")));
        isWide = Minecraft.getInstance().player.getSkin().model() == PlayerSkin.Model.WIDE;
    }

    @Override
    public GeoModel<TestArm> getGeoModel() {
        return isWide ? wide : model;
    }

    @Override
    public ResourceLocation getTextureLocation(TestArm animatable) {
        return Minecraft.getInstance().player.getSkin().texture();
    }
}
